<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 练习:单击时触发单击事件， 双击时只触发双击事件 

        //BOM:setTimeOut()
        //单击
            btn.addEventListener('click',fn);
            function fn() {
                alert('2班');
                // btn.removeEventListener('click',fn);
            } 
        //双击
            btn.addEventListener('dblclick',fn1);
            function fn1() {
                alert('4班');
            }

            var time=setTimeout();
            if (time>2) {
                
            }
    </script>
</body>
</html>